﻿<?php
	session_start();
	include_once "config.php";
	require_once "classe/BD.php";
	$bd = new BD();
	$bd->conexao();

	if(isset($_SESSION['valida'])){
		if($_SESSION['valida'] != 0)
			header('location: chat.php');
	}
?>
<!DOCTYPE html>
<html lang="pt-BR" class="no-js">
    <head>
        <meta charset="UTF-8" />
       
        <title>Seja Bem-vindo ao MIDEA </title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
        <meta name="description" content="Login and Registration Form with HTML5 and CSS3" />
        <meta name="keywords" content="html5, css3, form, switch, animation, :target, pseudo-class" />
        <meta name="author" content="Codrops" />
       <!-- <link rel="shortcut icon" href="../favicon.ico"> -->
        <link rel="stylesheet" type="text/css" media="screen" href="css/pagina.css" />
        <link rel="stylesheet" type="text/css" media="screen" href="css/style.css" />
		<link rel="stylesheet" type="text/css" media="screen" href="css/animate-custom.css" />
        <link rel="stylesheet" type="text/css" media="screen" href="css/email.css" />
        <script src="js/jquery-1.8.3.min.js"></script>
    	<script type="text/javascript">
    		$(document).ready(function() {
        		$("#prodimg").change(function(e) {
                	for (var i = 0; i < e.originalEvent.srcElement.files.length; i++) {
                       var file = e.originalEvent.srcElement.files[i];

                       var reader = new FileReader();
                       reader.onloadend = function() {
                               $("#preview").attr("src", reader.result);
                       }
                       reader.readAsDataURL(file);
               		}
       			});
   			});
   		</script>
        <script type="text/javascript">
        	$(document).ready(function(){
				$('fieldset').hide();
						
						$("a.esq").click( function(ev){
							ev.preventDefault();
					 
							var id = $(this).attr("href");
					 
							var alturaTela = $(document).height();
							var larguraTela = $(window).width();
						 
							//colocando o fundo preto
							$('#mascara').css({'width':larguraTela,'height':alturaTela});
							$('#mascara').fadeIn(1000);
							$('#mascara').fadeTo("slow",0.9);
					 
							var left = ($(window).width() /2) - ( $(id).width() / 2 );
							var top = ($(window).height() / 2) - ( $(id).height() / 2 );
						 
							$(id).css({'top':top,'left':left});
							$(id).show();  
							
							$("fieldset").slideDown(500);
						});
					 
						$("#mascara").click( function(){
							$(this).hide();
							$("fieldset").hide(500);
						});
					 
			});// JavaScript Document
        </script>
    </head>
    <body>
       <section>				
        
                <a class="hiddenanchor" id="toregister"></a>
                <a class="hiddenanchor" id="tologin"></a>
               
                    <div id="formulario">
                        <div id="login" class="animate form">
                            <form  action="logar.php" method="post" autocomplete="on" enctype="multipart/form-data">
                                <h1>Entrar</h1> 
                                <p> 
                                    <label for="Nome" class="senha" data-icon="u" >Entre com E-mail </label>
                                    <input id="nome" name="email" required type="email" placeholder="Nome@Email.com"/>
                                </p>
                                <p> 
                                    <label for="password" class="senha" data-icon="p">Senha</label>
                                    <input id="senha" name="senha" required type="password" placeholder="X8df!90EO"/> 
                                </p>
                                
                                <p class="login button"> 
                                	<a href="#" class="esq" style="float:left;text-decoration:none;color:#900;margin-top:20px;">
                                    	Esqueceu sua senha?
                                    </a>
                                	<input type="hidden" name="acao" value="logar">
                                    <input type="submit" value="Entrar" /> 
                                </p>
                                <p class="obs">
                                    Se você não possui uma conta no MIDEA
                                    <a href="#toregister" class="to_register">Cadastre-Se</a>
                                </p>
                            </form>
                        </div>
                    
    
    
    
                     <div id="cadastro" class="animate form" style="margin-top:-35%;">
                            <form name="form_2" enctype="multipart/form-data" action="inserir.php" method="post" autocomplete="on"> 
                                <h1>Cadastro</h1> 
                                <p>
                                	<input type="hidden"  value="10000000">                   
                                </p>
                                <p> 
                                    <label for="nome" class="nome">Selecione uma Imagem</label>
                                    <input type="file" id="prodimg" name="img" required />
                           			<img src="images/camera-icon.png" id="preview"/>
                                </p>
                                
                               	<p> 
                                    <label for="nome" class="nome" data-icon="u">Digite seu Nome</label>
                                    <input id="nome" name="nome" required type="text" placeholder="Joaquin" maxlength="20" />
                                </p>
                                <p> 
                                    <label for="email" class="email" data-icon="e" >Digite seu Email</label>
                                    <input id="email" name="email" required type="email" placeholder="Nome@Email.com"/> 
                                </p>
                                <p> 
                                    <label for="senha" class="senha" data-icon="p">Digite sua Senha </label>
                                    <input id="senha" name="senha" required type="password" placeholder="X8df!90EO"/>
                                </p>
                                <p> 
                                    <label for="senha_confirm" class="senha" data-icon="p">Digite Sua Senha Novamente</label>
                                    <input id="senha_confirm" name="senha_confirm" required type="password" placeholder="X8df!90EO"/>
                                </p>
                                <p class="signin button"> 
                                    <input type="submit" value="Cadastrar"/> 
                                </p>
                                 <p class="obs">  
                                    Já possui uma conta no MIDEA ?
                                    <a href="#tologin" class="to_register"> Voltar </a>
                                </p>
                            </form>
                        </div>
                    </div>
                    
                    <form method="post" action="enviar_email_recuperar_senha.php" id="form">
            			<fieldset>
                			<legend>Recupere sua senha</legend>
                    		<input type="email" data-icon="u" name="email" id="recup" placeholder="Digite seu email para recuperação de senha" required>
                            <p class="enviar">
                                <input type="submit" value="Enviar">
                            </p>
                        </fieldset>
        			</form>
            
            		<!--mascara para cobrir o site -->  
        			<div id="mascara"></div>
    	</section>
    </body>
</html>
